<template>
	<view class="classLog-page">
		<nodate v-if="list.length<1" />
		<scroll-view :scroll-top="scrollTop" scroll-y="true" class="list-box" :style="'height: '+ wagesheight + 'px'"
		 @scrolltolower="lower" v-else>
			<u-card margin="20rpx" v-for="(el,i) in list" :key="i" :show-foot="false">
				<view slot="head" class="u-flex u-row-between">
					<text class="u-font-34 yu-bold">{{el.lessioninfo}}</text>
					<u-tag text="正常" mode="plain" type="success" v-if="el.status==1"/>
					<u-tag text="请假" mode="plain" type="error" v-if="el.status==2"/>
					<u-tag text="补课" mode="plain" type="warning" v-if="el.status==3"/>
				</view>
				<view class="" slot="body">
					<view class="u-flex u-row-between">
						<u-image width="200rpx" height="200rpx" :src="el.img ? $api.json('baseUrl')+'/upload/' + el.img : '../../static/textbook.png'"></u-image>
						<view class="u-p-l-20">
							<view class="u-font-34  yu-bold u-p-b-30">
								<text class="u-font-30">学生：</text>{{el.stuname}}
							</view>
							<view class="u-font-34  yu-bold u-p-b-30">
								<text class="u-font-30">老师：</text>{{el.empname}}
							</view>
							<view class="u-font-34">
								<text class="u-font-30 yu-bold">时间：</text>{{el.createtime}}
							</view>
						</view>
					</view>
					<u-collapse :arrow="true">
						<u-collapse-item title="课程内容">
							<view class="">
								{{el.content}}
							</view>
						</u-collapse-item>
					</u-collapse>
				</view>
			</u-card>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				scrollTop: 0,
				old: {
					scrollTop: 0
				},
				wagesheight: '500',
				list: []
			}
		},
		onShow() {
			uni.getSystemInfo({
				success: (res) => {
					console.log(res);
					this.wagesheight = res.windowHeight
				}
			})
			this.getData()
		},
		onPullDownRefresh() {
			this.getData()
		},
		methods: {
			lower() {

			},
			getData() {
				uni.showLoading({
					title: '加载中'
				});
				uni.request({
					method: 'POST',
					url: this.$api.json('baseUrl') + '/payment/h5findSignLog',
					success: (res) => {
						uni.stopPullDownRefresh();
						uni.hideLoading()
						if (res.data.resultCode === '000000') {
							this.list = res.data.data
						} else if (res.data.resultCode === '200009') {
							uni.redirectTo({
								url: '/pages/login/login'
							})
						} else {
							this.$api.msg(res.errMsg);
						}
					}
				});
			}
		}
	}
</script>

<style lang="less">
	.classLog-page {
		.list-box {
		}
	}
</style>
